#define _CRT_SECURE_NO_WARNINGS
#pragma	once

#define NAME_M 20
#define TEL_M 12
#define ADDRESS_M 20
//#define ARR_M 50
#define	DEFAULT_SZ 3
#define ADDITION_SZ 2

#include <stdio.h>
#include <memory.h>
#include <string.h>
#include <errno.h>
#include <search.h>
#include <stdlib.h>
#include <assert.h>

typedef enum Options
{
	EXIT,
	ADD,
	DELETE,
	SEARCH,
	MODIFY,
	SORT,
	DISPLAY
}Options;

typedef enum Sex
{
	MALE,
	FEMALE,
	OTHER
}Sex;

typedef struct info
{
	char name[NAME_M];
	Sex sex;
	int age;
	char tel[TEL_M];
	char address[ADDRESS_M];
}info;

typedef struct con
{
	//info arr[ARR_M];
	info* arr;
	int sz;
	int capa;
}con;

void Menu();

void Init(con* pContact);

void Add(con* pContact);

void Delete(con* pContact);

void Search(const con* pContact);

void Modify(con* pContact);

void Sort(con* pContact);

void Display(const con* pContact);

int SearchByName(char* name, con* pContact);

void Save(con* pContact);

void Load(con* pContact);